package tests;

import common.Utils;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;

import javax.rmi.CORBA.Util;

/**
 * Created with IntelliJ IDEA.
 * Description:自动化测试博客系统细节页面
 * Author: WJW
 * Date: 2024-10-13
 * Time: 14:47
 */
public class DetailPage extends Utils {
    public static String url = "http://8.137.19.140:9090/blog_detail.html";

    public DetailPage() {
        super(url);
    }

    public void DetailByLogin() throws InterruptedException {
        //处理警告 弹窗
        //切换弹窗
        Thread.sleep(1000);
        Alert alert = driver.switchTo().alert();
        //点击确认
        alert.accept();

        //通过GitHub地址按钮
        driver.findElement(By.cssSelector("body > div.container > div.left > div > a"));
    }
}
